require "import"
import("android.view.accessibility.AccessibilityNodeInfo")

if node.packageName ~= "com.android.systemui" then
service.speak("Not in the notification shade")
return true
end
if node.className ~= "android.widget.FrameLayout" then
service.speak("Not on a notification.")
return true
end
if node.performAction(AccessibilityNodeInfo.ACTION_DISMISS) then
service.appendSpeak("Notification dismissed.")
else
service.speak("Notification cannot be dismissed.")
end
return true